package com.ruoyi.controller;

import com.ruoyi.entity.JrVersion;
import com.ruoyi.service.VersionService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "VersionController   api")
@Slf4j
@RequestMapping("/api/version")
public class VersionController {
    @Autowired
    private VersionService versionService;

    @GetMapping("/file/{fileId}")
    public List<JrVersion> getVersionsByFileId(@PathVariable Long fileId,@RequestParam String fileName) {
        List<JrVersion> versions = versionService.getVersionsByFileId(fileId,fileName);
        return versions;
    }
}
